<?php
	@session_start();
	
	require_once('../../lib/'.'BaseDir.inc.htm');	
    require_once(EIU_LIB . 'View.class.htm');	
	require_once (EIU_CLASS.'LoginClass.htm');
	
	//Lay thong tin cua User Login
	/*
	$currentLink = explode("/",$_SERVER['REQUEST_URI']);	
	if(checkSession("'".$currentLink[count($currentLink)-1]."'")==true){
		$data = setSession();
	}
	*/	
	//print_r($_POST);
	
	if(isset($_SESSION['userID'])&&!empty($_SESSION['userID']))
	{
		
		$view = new View();
		$data1["CreateNew"] = $_POST["CreateNew"];
		$data1["IOCode"] = $_POST["IOCode"];
		
		//Set init value info
		$data["titlePage"] = "A2.2. TẠO MỚI PHIẾU NHẬP KHO";	
		$data1["titlePage"] = $data["titlePage"];	
		
		
		$data['userName'] 			= $_SESSION['userName'];
		$data['userLoginTime'] 		= $_SESSION['userLoginTime'];
		$data['userId'] 			= $_SESSION['userID'];
		$data['userEID']			= $_SESSION['userEID'];
		$data['isLogin']			= $_SESSION['isLogin'];		
		
		
		$data1["Header"] = $view->returnTmpl("header.tmpl","n",$data);
		
		$template = $view->returnTmpl("IODetail.tmpl","n",$data1);
	}
	else
	{
		$strLocation = "login.htm";
		echo '<script type="text/javascript">';
		echo " location.href='".$strLocation."';";
		echo "</script>";
	}	
	
	
	
	echo $template;
?>